<?php	
	
include ("./src/jpgraph.php");
include ("./src/jpgraph_line.php");
$graph = new Graph(900,550,"auto");
$graph->SetScale("textlin");

$graph->img->SetMargin(50,30,20,120);    
$graph->SetShadow();

$datax=array("VC","O","S","D","C","P","Tr","J","K","Pg","Ng");
$datay=array("1701","848","166","410","108","42","14","7","29","16","5");

$datay2=array("39","266","213","452","317","407","550","686","1712","1385","949");

$datay3=array("101","1298","1018","2428","1503","1367","883","1387","1403","257","134");


$graph->title->Set('Brachiopoda Extinction By Period');
$graph->title->SetFont(FF_FONT1,FS_BOLD);


$dplot = new LinePLot($datay);
$dplot2 = new LinePLot($datay2);
$dplot3 = new LinePLot($datay3);

$dplot->SetFillColor("blue");
$dplot2->SetFillColor("green");
$dplot3->SetFillColor("red");

$dplot->SetLegend("Cm");
$dplot2->SetLegend("Md");
$dplot3->SetLegend("Pz");


// Create the accumulated graph
$accplot = new AccLinePlot(array($dplot,$dplot3, $dplot2));

// Add the plot to the graph
$graph->Add($accplot);

//$p1 = new LinePlot($datay);
//$p1->SetFillColor("blue");
//$p1->mark->SetType(MARK_FILLEDCIRCLE);
//$p1->mark->SetFillColor("red");
//$p1->mark->SetWidth(4);
$graph->yaxis->title->SetMargin(10);

$graph->yaxis->title->Set("Number of Genera");
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->title->SetMargin(80);
$graph->xaxis->title->Set("Period Interval");

$graph->Stroke();
?>